<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/view/common/taglibs.jsp" %>
<script type="text/javascript">

function changeType(value){

	type = value;
	var orgType = <s:property value="@com.jysz.certificate.persistence.enums.OrganizationEnum@ORG.index"/>;
	if(orgType == value){
		//TODO:名称可以编辑，选择框消失
		$("#nameField").attr({"readonly":false});
		$("#nameField").removeClass("input_readOnly_80").addClass("input_90");
	//	$('#selectObjectField').toggle();
		$('#selectObjectField').css('display','none');
	}else{
		//TODO:名称不可编辑，出现选择框	
		$("#nameField").attr({"readonly":"readonly"});
		$("#nameField").removeClass("input_90").addClass("input_readOnly_80");
		$('#selectObjectField').css('display','inline-block');
		//$('#selectObjectField').toggle();
	}
	
	$("#nameField").attr({"value":""});
	$("#objectIdField").attr({"value":""});
}


</script>
	<input type='hidden' name='search.name' value='${search.name}'/>
	<input type='hidden' name='pid' value='${pid}'/>
	<input type='hidden' name='entity.id' value='${entity.id}'/>
	<input type='hidden' name='entity.type' value='${entity.type}'/>
	<input type='hidden' name='redirectUrl' value='<s:property value='redirectUrl'/>'/>
	
	<table width="100%" border="0" cellpadding="1" cellspacing="1">
		<tr>
			<td class="left-td-width-bg">
					类型：
				</td>
				<td width="15%">
					<s:property value="entity.type.name"/>
				</td>
			<td class="left-td-width-bg">
				<font color="red">*</font>名称：
			</td>
			<td>
				<input name="entity.name" id="nameField" class="input"  type="text" id="name" size="16"
					 value="<s:property value='entity.name'/>" dataType="Require"  msg="名称不能为空" />
			</td>	
		</tr>
		<tr>
			<td class="left-td-width-bg">
				父节点：
			</td>
			<td colspan="5">
				<s:property value="entity.parent.name"/>
			</td>
		</tr>
			<%-- <tr>
				<td class="left-td-width-bg">
					<font color="red">*</font>排序：
				</td>
				<td>
					<input name="entity.order" class="input" type="text" id="order" size="16" readonly="readonly"
						value="<s:property value='entity.order'/>" onchange="javascript:changeCode(this.value);" />
				</td>	
				<td colspan="4"></td>			
			</tr> --%>

	</table>
	 <table width="100%">
            	<tr>
                	<td><div align="center">
                	  <input type="submit" name="submit" value="" class="btn_save" />
                	&nbsp;&nbsp;
                      <input type="reset" name="reset" value="" class="btn_rest" onclick="clearForm(this.form);return false;"/>
                    </div>
                    </td>
                </tr>
     </table>        